#ifndef __HELLOWORLD_SCENE_H__
#define __HELLOWORLD_SCENE_H__

#include "cocos2d.h"
#include "Box2D/Box2D.h"
#include "Player.h"

#include "GLES-Render.h"

using namespace cocos2d;

class CustomButton;
class CameraController;
class LevelHelperLoader;

class HelloWorld : public cocos2d::CCLayer
{
	b2World* world;
	b2World* copyOfWorld;
	b2Body* groundBody;

	CCLayer* GuiLayer;
	CCLayer* GameLayer;

	Player* player;
	
	CameraController* camController;
    
    LevelHelperLoader* lh;
    
    GLESDebugDraw* m_debugDraw;
    
public:

	HelloWorld();
	virtual ~HelloWorld();

	// Here's a difference. Method 'init' in cocos2d-x returns bool, instead of returning 'id' in cocos2d-iphone
	virtual bool init();  

	// there's no 'id' in cpp, so we recommand to return the exactly class pointer
	static cocos2d::CCScene* scene();
	
	// a selector callback
	void menuCloseCallback(CCObject* pSender);

	void initPyshicsWorld();
	void initPyshicsPlayer();

	void update(ccTime dt);
	virtual void draw();
    
    
    virtual bool ccTouchBegan(CCTouch* touch, CCEvent* event);
	virtual void ccTouchEnded(CCTouch* touch, CCEvent* event);
	virtual void ccTouchCancelled(CCTouch *touch, CCEvent* event);
	virtual void ccTouchMoved(CCTouch* touch, CCEvent* event);
    

    virtual void ccTouchesBegan(CCSet *pTouches, CCEvent *pEvent){};
 	virtual void ccTouchesMoved(CCSet *pTouches, CCEvent *pEvent){};
 	virtual void ccTouchesEnded(CCSet *pTouches, CCEvent *pEvent){};
 	virtual void ccTouchesCancelled(CCSet *pTouches, CCEvent *pEvent){};

	// implement the "static node()" method manually
	LAYER_NODE_FUNC(HelloWorld);
};

#endif // __HELLOWORLD_SCENE_H__
